const rp = require('request-promise-native');

async function fetchMovie(item) {
    const url = `http://api.douban.com/v2/movie/subject/${item.doubanId}`
    const res = await rp(url)
    return res;
}

;
(async () => {
    let movies = [{
            doubanId: 26689427,
            title: '家有儿女初长成',
            rate: 7,
            poster: 'https://img3.doubanio.com/view/photo/l_ratio_poster/public/p2522704815.jpg'
        },
        {
            doubanId: 30128990,
            title: '素描',
            rate: 7.8,
            poster: 'https://img3.doubanio.com/view/photo/l_ratio_poster/public/p2522307076.jpg'
        }
    ]

    movies.map(async movie=>{
        let movieData = await fetchMovie(movie)
        console.log(JSON.parse(movieData))
    })
})()